package com.zegome.game.gomestory.main.helper;

import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.utils.BaseDrawable;
import com.zegome.game.gomestory.main.A;

public class UpdateDrawable extends BaseDrawable
{

	int rotate;	
	float tick;
	
	TextureRegion region;
	
	public UpdateDrawable( TextureRegion region)
	{
		rotate = 0;
		this.region = region;
	}
	
	public void act(float delta)
	{
		//if(tick>=0.2f)
		//{
			rotate+=2;
			tick = 0;
			if(rotate>360)
				rotate = 0;
		//}
		//else{
		//	tick += delta;
		//}
	}

	public void reset()
	{
		rotate = 0;
		tick = 0;
	}

	@Override
public void draw(SpriteBatch batch, float x, float y, float width, float height)
{
		batch.draw(region, x, y, 16, 16, 32, 32,
				1f, 1f, rotate);
}
}